﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace ConfigForm.BLL
{
    class TPriceUnit
    {
        UTLDB.UTLDB connect = new UTLDB.UTLDB();
        public DataTable GetPriceUnit()
        {

            DataTable data = connect.GetDataByStoredProcedure("usp_SelecttblPriceUnitsAll");
            return data;
        }
        public bool UpdatePriceUnit(CPriceUnit priceunit)
        {
            //usp_UpdatetblPriceUnit
            string strStoreName = "usp_UpdatetblPriceUnit";
            string strPara = "@ID~@IdType~@IdUnit~@Price~@Date";
            string strValue = priceunit.ID + "~" + priceunit.IdType + "~" + priceunit.IdUnit + "~" + priceunit.Price + "~" + priceunit.Date;
            UTLDB.UTLDB prv = new UTLDB.UTLDB();
            return true;
            //prv.ExecuteNonQuery(strStoreName, strPara, strValue);

        }
        public DataTable GetType()
        {

            DataTable data = connect.GetDataByStoredProcedure("sp_SelecttblProductTypesAll");
            return data;
        }
        public DataTable GetUnit()
        {

            DataTable data = connect.GetDataByStoredProcedure("sp_Select_tblUnit");
            return data;
        }
        public DataTable GetMaterial()
        {
            DataTable data = connect.GetDataByStoredProcedure("usp_SelecttblMaterial");
            return data;
        }
        public DataTable GetSeedType()
        {
            DataTable data = connect.GetDataByStoredProcedure("usp_SelecttblSeedType");
            return data;
        }
        public DataTable GetQuality()
        {
            DataTable data = connect.GetDataByStoredProcedure("usp_SelecttblQuality");
            return data;
        }
        public DataTable GetSeed()
        {
            DataTable data = connect.GetDataByStoredProcedure("sp_SelecttblSeedsAll");
            return data;
        }
    }
    public class CPriceUnit
    {
        private int _id;
        public int ID
        {
            get { return _id; }
            set { _id = value; }
        }
        private int _idType;
        public int IdType
        {
            get { return _idType; }
            set { _idType = value; }
        }
        private int _idUnit;
        public int IdUnit
        {
            get { return _idUnit; }
            set { _idUnit = value; }
        }
        private int _price;
        public int Price
        {
            get { return _price; }
            set { _price = value; }
        }
        private DateTime _date;
        public DateTime Date
        {
            get { return _date; }
            set { _date = value; }
        }
    }
}
